package com.nacos.demo.controller;

import com.nacos.demo.property.CustomProperties;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author H
 * @date 2023/2/8
 */
@RestController
@RequiredArgsConstructor
public class TestController {

    private final CustomProperties customProperties;

    @GetMapping("test")
    public String test() {
        System.out.println("其他配置：" + customProperties.getOther());
        System.out.println("公共配置：" + customProperties.getCommonKey());
        return "基本配置：" + customProperties.getName() +
                "：" + customProperties.getDesc() +
                "；其他配置：" + customProperties.getOther() +
                "；公共配置：" + customProperties.getCommonKey();
    }
}
